//
//  PurchaseOrderDetailViewController.m
//  quxiangtao
//
//  Created by xbmios on 2018/7/16.
//  Copyright © 2018年 shanhaijin. All rights reserved.
//

#import "PurchaseOrderDetailViewController.h"

@interface PurchaseOrderDetailViewController ()

@property (strong, nonatomic) UIScrollView *contentScrollview;

// 公共部分
/** 标题*/
@property (strong, nonatomic) UILabel *titleL;
/**
 状态
 */
@property (strong, nonatomic) UILabel *statusL;

/** 图片*/
@property (strong, nonatomic) UIImageView *goodsIV;

/** 商品标题 */
@property (strong, nonatomic) UILabel *nameL;

/** 金额钱的logo*/
@property (strong, nonatomic) UIImageView *moneyLogoIV;

/** 金额*/
@property (strong, nonatomic) UILabel *moneyL;

/** 数量的图片*/
@property (strong, nonatomic) UIImageView *countIV;

/** 数量*/
@property (strong, nonatomic) UILabel *countL;

@property (strong, nonatomic) UILabel *rankL;

// 订单编号
@property (strong, nonatomic) UILabel *orderNumL;
@property (strong, nonatomic) UILabel *orderNum;
// 支付方式
@property (strong, nonatomic) UILabel *payMethodL;
@property (strong, nonatomic) UILabel *payMethod;
// 下单时间
@property (strong, nonatomic) UILabel *orderTimeL;
@property (strong, nonatomic) UILabel *orderTime;
// 立即支付 联系客服
@property (strong, nonatomic) UIImageView *payOrderIV;
@property (strong, nonatomic) UILabel *payOrderL;

// 进货待支付详情
@property (strong, nonatomic) UILabel *goodsMoneyL;
@property (strong, nonatomic) UILabel *goodsMoneyNumL;

@property (strong, nonatomic) UIImageView *cancleOrderIV;
@property (strong, nonatomic) UILabel *cancleOrderL;



// 其他
// 库存编号
@property (strong, nonatomic) UILabel *stockNumL;
@property (strong, nonatomic) UILabel *stockNum;
// 库存状态
@property (strong, nonatomic) UILabel *stockStatusL;
@property (strong, nonatomic) UILabel *stockStatus;
// 支付金额
@property (strong, nonatomic) UILabel *payMoneyL;
@property (strong, nonatomic) UILabel *payMoney;
// 已获积分
@property (strong, nonatomic) UILabel *getQuDouL;
@property (strong, nonatomic) UILabel *getQuDou;
// 预期分红
@property (strong, nonatomic) UILabel *expectedBonusL;
@property (strong, nonatomic) UILabel *expectedBonus;
// 预期收益
@property (strong, nonatomic) UILabel *expectedIncomeL;
@property (strong, nonatomic) UILabel *expectedIncome;
// 剩余冻结期限
@property (strong, nonatomic) UILabel *freezingPeriodL;
@property (strong, nonatomic) UILabel *freezingPeriod;
// 到期时间
@property (strong, nonatomic) UILabel *expirationTimeL;
@property (strong, nonatomic) UILabel *expirationTime;

@end

@implementation PurchaseOrderDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = WhiteColor;
    NSLog(@"%zd", self.tradeType);
    
    self.title = @"订单详情";
    
    [self setupSameUI];
    [self createUIwithTradeType:self.tradeType];
    
    
    
#warning contentheight 为0，self.contentScrollview.contentSize为CGSizeMake(0, 0)
    CGFloat contentHeight = CGRectGetMaxY(self.payOrderIV.frame);
//    NSLog(@"%@===%.2f", NSStringFromCGRect(self.payOrderIV.frame), contentHeight);
    self.contentScrollview.contentSize = CGSizeMake(0, contentHeight);
    
}

#pragma mark -公用部分布局
- (void)setupSameUI {
    
    [self.view addSubview:self.contentScrollview];
    [self.contentScrollview addSubview:self.titleL];
    [self.contentScrollview addSubview:self.statusL];
    [self.contentScrollview addSubview:self.goodsIV];
    [self.contentScrollview addSubview:self.nameL];
    [self.contentScrollview addSubview:self.moneyLogoIV];
    [self.contentScrollview addSubview:self.moneyL];
    [self.contentScrollview addSubview:self.countIV];
    [self.contentScrollview addSubview:self.countL];
    [self.contentScrollview addSubview:self.rankL];
    
    [self.contentScrollview addSubview:self.orderTimeL];
    [self.contentScrollview addSubview:self.orderTime];
    
    [self.contentScrollview addSubview:self.payMethodL];
    [self.contentScrollview addSubview:self.payMethod];
    
    [self.contentScrollview addSubview:self.orderNumL];
    [self.contentScrollview addSubview:self.orderNum];
    
    [self.contentScrollview addSubview:self.payOrderIV];
    [self.contentScrollview addSubview:self.payOrderL];
    
    __weak typeof(self) weakSelf = self;
    [self.contentScrollview mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left);
        make.right.mas_equalTo(weakSelf.view.mas_right);
        make.top.mas_equalTo(weakSelf.view.mas_top);
        make.bottom.mas_equalTo(weakSelf.view.mas_bottom);
    
    }];
    
    [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.contentScrollview.mas_top).with.offset(jisuan(10));
        
    }];
    
    [self.statusL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.contentScrollview.mas_top).with.offset(jisuan(10));
    }];
    
    [self.goodsIV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.titleL.mas_bottom).with.offset(jisuan(20));
        make.width.mas_equalTo(jisuan(120));
        make.height.mas_equalTo(jisuan(120));
    }];
    [self.moneyL sizeToFit];
    [self.moneyL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.statusL.mas_bottom).with.offset(jisuan(20));
        
        if (self.moneyL.text) {
            
            make.width.mas_equalTo(weakSelf.moneyL.width);
            make.height.mas_equalTo(weakSelf.moneyL.height);
      
        }
        
    }];
    
    [self.moneyLogoIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.moneyL.mas_left).with.offset(-jisuan(10));
        make.centerY.mas_equalTo(weakSelf.moneyL.mas_centerY);
        make.width.mas_equalTo(jisuan(14));
        make.height.mas_equalTo(jisuan(18));
    }];
    
    [self.nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.goodsIV.mas_right).with.offset(jisuan(30));
        make.top.mas_equalTo(weakSelf.goodsIV.mas_top);
        make.right.mas_equalTo(weakSelf.moneyLogoIV.mas_left).with.offset(-jisuan(30));
        
    }];
    [self.rankL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.nameL.mas_left);
        make.bottom.mas_equalTo(weakSelf.goodsIV.mas_bottom);
    }];
    
    
    [self.countL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.moneyL.mas_bottom).with.offset(jisuan(22));
        
    }];
    [self.countIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.countL.mas_left).with.offset(-jisuan(10));
        make.centerY.mas_equalTo(weakSelf.countL.mas_centerY);
        make.width.mas_equalTo(jisuan(14));
        make.height.mas_equalTo(jisuan(14));
        
    }];
    
}

- (void)createUIwithTradeType:(NSInteger)type {
    
    if (type == 2 || type == 3) {
        
        self.titleL.hidden = YES;
        self.rankL.hidden = YES;
    
    }else {
    
        self.titleL.hidden = NO;
        if (type == 0) {
            
            self.titleL.textColor = Color333333;
            self.rankL.hidden = YES;
            
        }else {
            
            self.titleL.textColor = Color1f89ff;
            self.rankL.hidden = NO;
            
        }
    
    }
    
    if (type == 0) {
        
        self.payOrderL.text = @"立即支付";
        
        [self createNotPayView];
        
    }else {
        
        self.payOrderL.text = @"联系客服";
        [self createOtherView];
        
    }
    
    
}

#pragma mark -取消订单
- (void)cancleGestureClick:(UIGestureRecognizer *)recognizer {
    
    NSLog(@"取消订单");
    
}

#pragma mark -立即支付
- (void)payOrderGestureClick:(UIGestureRecognizer *)recognizer {
    
    if (self.tradeType == 0) {
        
        NSLog(@"立即支付");
    
    }else {
        
        NSLog(@"联系客服");
        
    }

}

#pragma mark -待支付
- (void)createNotPayView {
    
    [self.contentScrollview addSubview:self.goodsMoneyL];
    [self.contentScrollview addSubview:self.goodsMoneyNumL];

    [self.contentScrollview addSubview:self.cancleOrderIV];
    [self.contentScrollview addSubview:self.cancleOrderL];

    __weak typeof(self) weakSelf = self;
    [self.goodsMoneyL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.goodsIV.mas_bottom).with.offset(jisuan(30));
        
    }];
    
    [self.goodsMoneyNumL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.goodsMoneyL.mas_top);
        
    }];
    
    [self.orderTimeL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.goodsMoneyL.mas_left);
        make.top.mas_equalTo(weakSelf.goodsMoneyL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.orderTime mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.orderTimeL.mas_top);
        
    }];
    [self.orderNumL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.goodsMoneyL.mas_left);
        make.top.mas_equalTo(weakSelf.orderTimeL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.orderNum mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.orderNumL.mas_top);
        
    }];
    
    [self.payMethodL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.goodsMoneyL.mas_left);
        make.top.mas_equalTo(weakSelf.orderNumL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.payMethod mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.payMethodL.mas_top);
        
    }];
    
    [self.payOrderIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.payMethodL.mas_bottom).with.offset(jisuan(106));
    }];
    [self.payOrderL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.mas_equalTo(weakSelf.payOrderIV.mas_centerX);
        make.centerY.mas_equalTo(weakSelf.payOrderIV.mas_centerY);
        
    }];
    
    [self.cancleOrderIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.payOrderIV.mas_left).with.offset(-jisuan(30));
        make.top.mas_equalTo(weakSelf.payOrderIV.mas_top);
    
    }];
    
    [self.cancleOrderL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.mas_equalTo(weakSelf.cancleOrderIV.mas_centerX);
        make.centerY.mas_equalTo(weakSelf.cancleOrderIV.mas_centerY);
        
    }];
    
}

#pragma mark -其他
- (void)createOtherView {

    [self.contentScrollview addSubview:self.stockNumL];
    [self.contentScrollview addSubview:self.stockNum];
    
    [self.contentScrollview addSubview:self.stockStatusL];
    [self.contentScrollview addSubview:self.stockStatus];
 
    [self.contentScrollview addSubview:self.payMoneyL];
    [self.contentScrollview addSubview:self.payMoney];
    
    [self.contentScrollview addSubview:self.getQuDouL];
    [self.contentScrollview addSubview:self.getQuDou];
    
    [self.contentScrollview addSubview:self.expectedBonusL];
    [self.contentScrollview addSubview:self.expectedBonus];
    
    [self.contentScrollview addSubview:self.expectedIncomeL];
    [self.contentScrollview addSubview:self.expectedIncome];
    
    [self.contentScrollview addSubview:self.freezingPeriodL];
    [self.contentScrollview addSubview:self.freezingPeriod];
    
    [self.contentScrollview addSubview:self.expirationTimeL];
    [self.contentScrollview addSubview:self.expirationTime];

    __weak typeof(self) weakSelf = self;
    [self.orderNumL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.goodsIV.mas_bottom).with.offset(jisuan(30));
    }];
    [self.orderNum mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.orderNumL.mas_top);
    
    }];
    
    [self.stockNumL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.orderNumL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.stockNum mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.stockNumL.mas_top);
    
    }];
    
    [self.stockStatusL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.stockNumL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.stockStatus mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.stockStatusL.mas_top);
   
    }];
    
    [self.payMethodL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.stockStatusL.mas_bottom).with.offset(jisuan(30));
    
    }];
    [self.payMethod mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.payMethodL.mas_top);
   
    }];
    
    [self.payMoneyL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.payMethodL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.payMoney mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.payMoneyL.mas_top);
    
    }];
    
    [self.getQuDouL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.payMoneyL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.getQuDou mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.getQuDouL.mas_top);
    }];
    
    [self.expectedBonusL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.getQuDouL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.expectedBonus mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.expectedBonusL.mas_top);
    }];
    
    [self.expectedIncomeL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.expectedBonusL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.expectedIncome mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.expectedIncomeL.mas_top);
    }];
    
    [self.freezingPeriodL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.expectedIncomeL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.freezingPeriod mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.freezingPeriodL.mas_top);
    }];
    
    [self.expirationTimeL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.freezingPeriodL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.expirationTime mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.expirationTimeL.mas_top);
    }];
    [self.orderTimeL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.expirationTimeL.mas_bottom).with.offset(jisuan(30));
    }];
    [self.orderTime mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.orderTimeL.mas_top);
    }];
    
    [self.payOrderIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.orderTimeL.mas_bottom).with.offset(jisuan(106));
    }];
    [self.payOrderL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.mas_equalTo(weakSelf.payOrderIV.mas_centerX);
        make.centerY.mas_equalTo(weakSelf.payOrderIV.mas_centerY);
        
    }];
    
}

#pragma mark -lazy
- (UILabel *)titleL {
    
    if (!_titleL) {
       
        _titleL = [[UILabel alloc] init];
        _titleL.text = @"理财店铺";
        _titleL.textAlignment = NSTextAlignmentLeft;
        _titleL.font = Font(24);
        _titleL.textColor = Color333333;
        
    }
   
    return _titleL;
    
}

- (UIScrollView *)contentScrollview {
    
    if (!_contentScrollview) {
        
        _contentScrollview = [[UIScrollView alloc] initWithFrame:CGRectZero];
        _contentScrollview.backgroundColor = WhiteColor;
        _contentScrollview.showsVerticalScrollIndicator = NO;
        _contentScrollview.showsHorizontalScrollIndicator = NO;
    }
    
    return _contentScrollview;

}

- (UILabel *)statusL {
    
    if (!_statusL) {
        
        _statusL = [[UILabel alloc] init];
        _statusL.textColor = Colorff4200;
        _statusL.text = @"等待支付";
        _statusL.font = Font(24);
        _statusL.textAlignment = NSTextAlignmentRight;
        _statusL.backgroundColor = WhiteColor;
        
    }
    
    return _statusL;
}

- (UIImageView *)goodsIV {
    
    if (!_goodsIV) {
        
        _goodsIV = [[UIImageView alloc] init];
        _goodsIV.contentMode = UIViewContentModeScaleAspectFit;
        _goodsIV.image = [UIImage imageNamed:@"goodsBG"];
    }
    
    return _goodsIV;
}

- (UILabel *)nameL {
    
    if (!_nameL) {
        
        _nameL = [[UILabel alloc] init];
        _nameL.textColor = Color333333;
        _nameL.numberOfLines = 2;
        
//        NSString *str = @"理财红包，十块钱;理财红包，十块钱;理财红包，十块钱;理财红包，十块钱;理财红包，十块钱";
//        NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc] initWithString:str];
//        NSMutableParagraphStyle *pargStyle = [[NSMutableParagraphStyle alloc] init];
//        [pargStyle setLineSpacing:jisuan(5)];
//        [attributeStr addAttribute:NSParagraphStyleAttributeName value:pargStyle range:NSMakeRange(0, str.length)];
//        _nameL.attributedText = attributeStr;
        _nameL.lineBreakMode = NSLineBreakByCharWrapping;
        
        _nameL.font = Font(24);
        _nameL.textAlignment = NSTextAlignmentLeft;
        _nameL.backgroundColor = WhiteColor;
        
    }
    
    return _nameL;
}

- (UILabel *)moneyL  {
    
    if (!_moneyL) {
        
        _moneyL = [[UILabel alloc] init];
        _moneyL.textColor = Color333333;
        _moneyL.text = @"99999.00";
        _moneyL.font = Font(24);
        _moneyL.textAlignment = NSTextAlignmentRight;
        _moneyL.backgroundColor = WhiteColor;
        
    }
    
    return _moneyL;
    
}

- (UIImageView *)moneyLogoIV {
    
    if (!_moneyLogoIV) {
        
        _moneyLogoIV = [[UIImageView alloc] init];
        _moneyLogoIV.contentMode = UIViewContentModeScaleAspectFit;
        _moneyLogoIV.image = [UIImage imageNamed:@"moneyLogoBG"];
    }
    
    return _moneyLogoIV;
    
}

- (UILabel *)countL {
    
    if (!_countL) {
        
        _countL = [[UILabel alloc] init];
        _countL.textColor = Color9b9b9b;
        _countL.text = @"1";
        _countL.font = Font(24);
        _countL.textAlignment = NSTextAlignmentRight;
        
        _countL.backgroundColor = WhiteColor;
    }
    
    return _countL;
    
}
- (UIImageView *)countIV {
    
    if (!_countIV) {
        
        _countIV = [[UIImageView alloc] init];
        _countIV.contentMode = UIViewContentModeScaleAspectFit;
        _countIV.image = [UIImage imageNamed:@"countOrderBG"];
    }
    
    return _countIV;
    
}
- (UILabel *)rankL {
    
    if (!_rankL) {
        
        _rankL = [[UILabel alloc] init];
        _rankL.textAlignment = NSTextAlignmentLeft;
        _rankL.textColor = Color1f89ff;
        _rankL.text = @"当前排位：10";
        _rankL.font = Font(20);
        
    }
    
    return _rankL;
}

- (UILabel *)goodsMoneyL {
    
    if (!_goodsMoneyL) {
        
        _goodsMoneyL = [[UILabel alloc] init];
        _goodsMoneyL.textAlignment = NSTextAlignmentLeft;
        _goodsMoneyL.textColor = Color333333;
        _goodsMoneyL.text = @"商品总价";
        _goodsMoneyL.font = Font(24);
        
    }
    
    return _goodsMoneyL;
}

- (UILabel *)goodsMoneyNumL {
    
    if (!_goodsMoneyNumL) {
        
        _goodsMoneyNumL = [[UILabel alloc] init];
        _goodsMoneyNumL.textAlignment = NSTextAlignmentRight;
        _goodsMoneyNumL.textColor = Color9b9b9b;
        _goodsMoneyNumL.text = @"10.00元";
        _goodsMoneyNumL.font = Font(24);
        
    }
    
    return _goodsMoneyNumL;
}

- (UILabel *)orderTimeL {
    
    if (!_orderTimeL) {
        
        _orderTimeL = [[UILabel alloc] init];
        _orderTimeL.textAlignment = NSTextAlignmentLeft;
        _orderTimeL.textColor = Color333333;
        _orderTimeL.text = @"下单时间";
        _orderTimeL.font = Font(24);
        
    }
    
    return _orderTimeL;
}

- (UILabel *)orderTime {
    
    if (!_orderTime) {
        
        _orderTime = [[UILabel alloc] init];
        _orderTime.textAlignment = NSTextAlignmentRight;
        _orderTime.textColor = Color9b9b9b;
        _orderTime.text = @"2018-06-29 15:12:23";
        _orderTime.font = Font(24);
        
    }
    
    return _orderTime;
}


- (UILabel *)orderNumL {
    
    if (!_orderNumL) {
        
        _orderNumL = [[UILabel alloc] init];
        _orderNumL.textAlignment = NSTextAlignmentLeft;
        _orderNumL.textColor = Color333333;
        _orderNumL.text = @"订单编号";
        _orderNumL.font = Font(24);
        
    }
    
    return _orderNumL;
}

- (UILabel *)orderNum {
    
    if (!_orderNum) {
        
        _orderNum = [[UILabel alloc] init];
        _orderNum.textAlignment = NSTextAlignmentRight;
        _orderNum.textColor = Color9b9b9b;
        _orderNum.text = @"132874978902374";
        _orderNum.font = Font(24);
        
    }
    
    return _orderNum;
}

- (UILabel *)payMethodL {
    
    if (!_payMethodL) {
        
        _payMethodL = [[UILabel alloc] init];
        _payMethodL.textAlignment = NSTextAlignmentLeft;
        _payMethodL.textColor = Color333333;
        _payMethodL.text = @"支付方式";
        _payMethodL.font = Font(24);
        
    }
    
    return _payMethodL;
}

- (UILabel *)payMethod {
    
    if (!_payMethod) {
        
        _payMethod = [[UILabel alloc] init];
        _payMethod.textAlignment = NSTextAlignmentRight;
        _payMethod.textColor = Color9b9b9b;
        _payMethod.text = @"支付宝";
        _payMethod.font = Font(24);
        
    }
    
    return _payMethod;
}

- (UIImageView *)cancleOrderIV {
    
    if (!_cancleOrderIV) {
        
        _cancleOrderIV = [[UIImageView alloc] init];
        _cancleOrderIV.contentMode = UIViewContentModeScaleAspectFit;
        _cancleOrderIV.image = [UIImage imageNamed:@"canclePurchaseBG"];
        
        _cancleOrderIV.userInteractionEnabled = YES;
        UITapGestureRecognizer *cancleGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancleGestureClick:)];
        [_cancleOrderIV addGestureRecognizer:cancleGesture];
        
    }
    
    return _cancleOrderIV;
}
- (UILabel *)cancleOrderL {
    
    if (!_cancleOrderL) {
        
        _cancleOrderL = [[UILabel alloc] init];
        _cancleOrderL.text = @"取消订单";
        _cancleOrderL.textColor = Color333333;
        _cancleOrderL.font = Font(24);
        _cancleOrderL.textAlignment = NSTextAlignmentCenter;
        _cancleOrderL.backgroundColor = WhiteColor;
        
    }
    
    return _cancleOrderL;
}

- (UIImageView *)payOrderIV {
    
    if (!_payOrderIV) {
        
        _payOrderIV = [[UIImageView alloc] init];
        _payOrderIV.contentMode = UIViewContentModeScaleAspectFit;
        _payOrderIV.image = [UIImage imageNamed:@"purchasePayBG"];
    
        _payOrderIV.userInteractionEnabled = YES;
        UITapGestureRecognizer *payOrderGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(payOrderGestureClick:)];
        [_payOrderIV addGestureRecognizer:payOrderGesture];
    
    }
    
    
    return _payOrderIV;
}
- (UILabel *)payOrderL {
    
    if (!_payOrderL) {
        
        _payOrderL = [[UILabel alloc] init];
        _payOrderL.textAlignment = NSTextAlignmentCenter;
        _payOrderL.textColor = WhiteColor;
        _payOrderL.text = @"立即支付";
        _payOrderL.font = Font(24);
        
    }
    
    return _payOrderL;
}

- (UILabel *)stockNumL {
    
    if (!_stockNumL) {
        
        _stockNumL = [[UILabel alloc] init];
        _stockNumL.textAlignment = NSTextAlignmentLeft;
        _stockNumL.textColor = Color333333;
        _stockNumL.text = @"库存编号";
        _stockNumL.font = Font(24);
        
    }
    
    return _stockNumL;
}

- (UILabel *)stockNum {
    
    if (!_stockNum) {
        
        _stockNum = [[UILabel alloc] init];
        _stockNum.textAlignment = NSTextAlignmentRight;
        _stockNum.textColor = Color9b9b9b;
        _stockNum.text = @"218730984218012";
        _stockNum.font = Font(24);
        
    }
    
    return _stockNum;
}
- (UILabel *)stockStatusL {
    
    if (!_stockStatusL) {
        
        _stockStatusL = [[UILabel alloc] init];
        _stockStatusL.textAlignment = NSTextAlignmentLeft;
        _stockStatusL.textColor = Color333333;
        _stockStatusL.text = @"库存状态";
        _stockStatusL.font = Font(24);
        
    }
    
    return _stockStatusL;
}

- (UILabel *)stockStatus {
    
    if (!_stockStatus) {
        
        _stockStatus = [[UILabel alloc] init];
        _stockStatus.textAlignment = NSTextAlignmentRight;
        _stockStatus.textColor = Color9b9b9b;
        _stockStatus.text = @"在售";
        _stockStatus.font = Font(24);
        
    }
    
    return _stockStatus;
}
- (UILabel *)payMoneyL {
    
    if (!_payMoneyL) {
        
        _payMoneyL = [[UILabel alloc] init];
        _payMoneyL.textAlignment = NSTextAlignmentLeft;
        _payMoneyL.textColor = Color333333;
        _payMoneyL.text = @"支付金额";
        _payMoneyL.font = Font(24);
        
    }
    
    return _payMoneyL;
}

- (UILabel *)payMoney {
    
    if (!_payMoney) {
        
        _payMoney = [[UILabel alloc] init];
        _payMoney.textAlignment = NSTextAlignmentRight;
        _payMoney.textColor = Color9b9b9b;
        _payMoney.text = @"10.00元";
        _payMoney.font = Font(24);
        
    }
    
    return _payMoney;
}
- (UILabel *)getQuDouL {
    
    if (!_getQuDouL) {
        
        _getQuDouL = [[UILabel alloc] init];
        _getQuDouL.textAlignment = NSTextAlignmentLeft;
        _getQuDouL.textColor = Color333333;
        _getQuDouL.text = @"已获积分";
        _getQuDouL.font = Font(24);
        
    }
    
    return _getQuDouL;
}

- (UILabel *)getQuDou {
    
    if (!_getQuDou) {
        
        _getQuDou = [[UILabel alloc] init];
        _getQuDou.textAlignment = NSTextAlignmentRight;
        _getQuDou.textColor = Color9b9b9b;
        _getQuDou.text = @"0.1";
        _getQuDou.font = Font(24);
        
    }
    
    return _getQuDou;
}

- (UILabel *)expectedBonusL {
    
    if (!_expectedBonusL) {
        
        _expectedBonusL = [[UILabel alloc] init];
        _expectedBonusL.textAlignment = NSTextAlignmentLeft;
        _expectedBonusL.textColor = Color333333;
        _expectedBonusL.text = @"预期分红";
        _expectedBonusL.font = Font(24);
        
    }
    
    return _expectedBonusL;
}

- (UILabel *)expectedBonus {
    
    if (!_expectedBonus) {
        
        _expectedBonus = [[UILabel alloc] init];
        _expectedBonus.textAlignment = NSTextAlignmentRight;
        _expectedBonus.textColor = Color9b9b9b;
        _expectedBonus.text = @"2.88";
        _expectedBonus.font = Font(24);
        
    }
    
    return _expectedBonus;
}

- (UILabel *)expectedIncomeL {
    
    if (!_expectedIncomeL) {
        
        _expectedIncomeL = [[UILabel alloc] init];
        _expectedIncomeL.textAlignment = NSTextAlignmentLeft;
        _expectedIncomeL.textColor = Color333333;
        _expectedIncomeL.text = @"预期收益";
        _expectedIncomeL.font = Font(24);
        
    }
    
    return _expectedIncomeL;
}

- (UILabel *)expectedIncome {
    
    if (!_expectedIncome) {
        
        _expectedIncome = [[UILabel alloc] init];
        _expectedIncome.textAlignment = NSTextAlignmentRight;
        _expectedIncome.textColor = Color9b9b9b;
        _expectedIncome.text = @"2.88";
        _expectedIncome.font = Font(24);
        
    }
    
    return _expectedIncome;
}

- (UILabel *)freezingPeriodL {
    
    if (!_freezingPeriodL) {
        
        _freezingPeriodL = [[UILabel alloc] init];
        _freezingPeriodL.textAlignment = NSTextAlignmentLeft;
        _freezingPeriodL.textColor = Color333333;
        _freezingPeriodL.text = @"剩余冻结期限";
        _freezingPeriodL.font = Font(24);
        
    }
    
    return _freezingPeriodL;
}

- (UILabel *)freezingPeriod {
    
    if (!_freezingPeriod) {
        
        _freezingPeriod = [[UILabel alloc] init];
        _freezingPeriod.textAlignment = NSTextAlignmentRight;
        _freezingPeriod.textColor = Color9b9b9b;
        _freezingPeriod.text = @"23";
        _freezingPeriod.font = Font(24);
        
    }
    
    return _freezingPeriod;
}

- (UILabel *)expirationTimeL {
    
    if (!_expirationTimeL) {
        
        _expirationTimeL = [[UILabel alloc] init];
        _expirationTimeL.textAlignment = NSTextAlignmentLeft;
        _expirationTimeL.textColor = Color333333;
        _expirationTimeL.text = @"到期时间";
        _expirationTimeL.font = Font(24);
        
    }
    
    return _expirationTimeL;
}

- (UILabel *)expirationTime {
    
    if (!_expirationTime) {
        
        _expirationTime = [[UILabel alloc] init];
        _expirationTime.textAlignment = NSTextAlignmentRight;
        _expirationTime.textColor = Color9b9b9b;
        _expirationTime.text = @"2018-06-29 15:12:23";
        _expirationTime.font = Font(24);
        
    }
    
    return _expirationTime;
}

#pragma mark -设置
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBar.hidden = NO;
//    self.tabBarController.tabBar.hidden = YES;
}
- (void)viewWillDisappear:(BOOL)animated {
    
    [super viewWillDisappear:animated];
    
//    self.navigationController.navigationBar.hidden = NO;
//    self.tabBarController.tabBar.hidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
